{template header}
<script language="javascript" type="text/javascript">
	J(function(){		
		J('#DistributionSubmit').bind('click', function(){
			J.ajax({
				type: "POST",
				url: 'cart-consignee.htm?action=distributionUpdate&id={$consignee[id]}',
				data: J('#theform').serialize(),
				cache: false,
				dataType: 'json',
				beforeSend: function(){
					J('#DistributionSubmit').attr('disabled','disabled');
					J('#loaddingImg').html('<img src="{GODHOUSE_DOMAIN_IMAGE}images/default/loading.gif" width="18" height="18" />');
					J('#loaddingText').html('请稍后，正在处理...');
				},
				success: function(data){
					if(data['state']==1) {							
						J('#ConsigneeInfo span').each(function(){
							if(J(this).attr('id')=='area') {	
								var province = J(this).children().eq(0).find("option:selected").text();
								var area = J(this).children().eq(1).find("option:selected").text();
								J('#areaInfo').html(J(this).html());
								J(this).html(area + '->' + province);
							}else{
								J(this).html(J(this).children().val());
							}
						});
						J('#DistributionSubmit').attr('disabled','');
						J('#loaddingImg').html('');
						J('#loaddingText').html('');
						J('#displaySubmit').hide();
					}
				}
			});
		});
		
		J('#consigneeEdit').bind('click', function(){
			var areaInfo = J('#areaInfo').html();
			if(J.trim(areaInfo)!=''){
				J('#ConsigneeInfo span').each(function(){
					if(J(this).attr('id')=='area') {						
						J('#areaInfo').empty();
						J(this).html(areaInfo);
						J('#province').val(J(this).attr('province')).change();
					}else{
						J(this).html('<input class=inputbg '+(J(this).attr('id')=='address' ? 'style="width:260px;"' : '' )+' name=info['+J(this).attr('id')+'] value="'+J(this).html()+'">');
					}
				});
				J('#displaySubmit').show();
			}
		});
	})
</script>
<style type="text/css">
.boldTitle{float:left; font-size:14px; font-weight:bold; padding:5px;}
</style>
<div class="maininfo">
	<div class="lattice x1" style="padding-left: 0;">
		{template userlogin}
	</div>
	<div class=x4>
		<form id=theform name=theform action="" method="post">
			<div style="margin-top:5px; border-top:2px #009900 solid">
				<span class="boldTitle">订单信息</span>
			</div>
			<table cellspacing=1 cellpadding=5 width="100%" align=center bgcolor=#dddddd border=0>
				<tr>
					<td width="15%" align="right" bgcolor=#ffffff><b>订单号：</b></td>
					<td width="37%" align="left" bgcolor=#ffffff>{$order[orderNo]}</td>
					<td width="16%" align="right" bgcolor=#ffffff><b>用户：</b></td>
					<td width="32%" align="left" bgcolor=#ffffff>{$order[userName]}</td>
					
				</tr>
				<tr>
					<td align="right" bgcolor=#ffffff><b>状态：</b></td>
					<td align="left" bgcolor=#ffffff>{$order[status]}</td>
					<td align="right" bgcolor=#ffffff><b>配送方式：</b></td>
					<td align="left" bgcolor=#ffffff>{$order[logistic]}</td>
				</tr>
				<tr>
					<td align="right" bgcolor=#ffffff><b>总价：</b></td>
					<td align="left" bgcolor=#ffffff>￥{$order[totalPrice]} <span style="color:#FF9900">{$order[payType]}</span></td>
					<td align="right" bgcolor=#ffffff><b>下单时间：</b></td>
					<td align="left" bgcolor=#ffffff>{$order[createdTime]}</td>
				</tr>
			</table>
			<div style="margin-top:0px; border-top:2px #009900 solid">
				<span class="boldTitle">收货人信息</span>
				<a style="float:right; font-weight:bold; color:#0033CC" href="#1" id="consigneeEdit">修改</a>
			</div>
			
			<div id="areaInfo" style="display:none">
				<select name="info[province]" id="province" style="width: 120px;" onchange="ajaxget('site-ajaxCity-'+this.value+'.htm', 'showCity', 'showCity', null, function(){J('#city').val(J('#area').attr('city'))})">
					<option value="">请选择区域</option>
					<!--{loop $areaList $v}-->
					<option value="{$v[id]}" {if $area[fId]==$v[id]}selected="selected"{/if}>{$v[name]}</option>
					<!--{/loop}-->
				</select>
				<label id="showCity">
				<select name="info[city]" id="city" style="width: 120px;">
					<option value="">请选择区域</option>
				</select>
				</label>
				<label style="color:red" id="err_city"></label>
			</div>
			
			<table cellspacing=1 cellpadding=5 width="99%" align=center bgcolor=#dddddd border=0 id="ConsigneeInfo">
				<tbody>
					<tr>
					  <td width="15%" align="right" bgcolor=#ffffff>地区：</td>
					  <td bgcolor=#ffffff><span id="area" province="{$consignee[province]}" city="{$consignee[city]}">{$consignee[cityInfo]}</span></td>
					  <td width="16%" align="right" bgcolor="#ffffff">电子邮件地址：</td>
					  <td width="32%" bgcolor="#ffffff"><span id="email">{$consignee[email]}</span></td>
				  </tr>
					<tr>
						<td align="right" bgcolor=#ffffff>收货人姓名：</td>
						<td width="37%" bgcolor=#ffffff><span id="realName">{$consignee[realName]}</span></td>
						<td align="right" bgcolor="#ffffff">邮政编码：</td>
						<td bgcolor="#ffffff"><span id="zipcode">{$consignee[zipcode]}</span></td>
					</tr>
					<tr>
						<td align="right" bgcolor=#ffffff>详细地址：</td>
						<td bgcolor=#ffffff><span id="address">{$consignee[address]}</span></td>
						<td align="right" bgcolor="#ffffff">手机：</td>
						<td bgcolor="#ffffff"><span id="mobile">{$consignee[mobile]}</span></td>
					</tr>
					<tr>
						<td align="right" bgcolor=#ffffff>电话：</td>
						<td bgcolor=#ffffff><span id="phone">{$consignee[phone]}</span></td>
						<td align="right" bgcolor="#ffffff">最佳送货时间：</td>
						<td bgcolor="#ffffff"><span id="bestTime">{$consignee[bestTime]}</span></td>
					</tr>
					<tr>
						<td align="right" bgcolor=#ffffff>标志建筑：</td>
						<td bgcolor=#ffffff><span id="signBuilding">{$consignee[signBuilding]}</span></td>
						<td align="right" bgcolor=#ffffff>&nbsp;</td>
						<td bgcolor=#ffffff>&nbsp;</td>
					</tr>
					<tr id="displaySubmit" style="display:none">
					  <td align=center bgcolor=#ffffff colspan=4>
						  <table width="100%" border="0" cellpadding="0" cellspacing="0">
							  <tr>
								<td width="51%" align="right"><input type=button value=配送至这个地址 name=submit id="DistributionSubmit"></td>
								  <td width="2%" align="left" style="padding-left:2px; padding-right:2px;" id="loaddingImg"></td>
								  <td width="47%" style="text-align:left"><label style="color:red" id="loaddingText"></label></td>
							  </tr>
						  </table>						  
					  </td>
					</tr>
				</tbody>
		  </table>
			  
			<!--<table cellspacing=1 cellpadding=5 width="100%" align=center bgcolor=#dddddd border=0>
				<tbody>
					<tr>
					  <td width="15%" align="right" bgcolor=#ffffff>收货人姓名：</td>
					  <td bgcolor=#ffffff>{$consignee[realName]}</td>
				      <td width="16%" align="right" bgcolor="#ffffff">电子邮件地址：</td>
				      <td width="32%" bgcolor="#ffffff">{$consignee[email]}</td>
				  </tr>
					<tr>
						<td align="right" bgcolor=#ffffff>地区：</td>
						<td width="37%" bgcolor=#ffffff>{$consignee[area]}</td>
						<td align="right" bgcolor="#ffffff">邮政编码：</td>
						<td bgcolor="#ffffff">{$consignee[zipcode]}</td>
					</tr>
					<tr>
						<td align="right" bgcolor=#ffffff>详细地址：</td>
						<td bgcolor=#ffffff>{$consignee[address]}</td>
						<td align="right" bgcolor="#ffffff">手机：</td>
						<td bgcolor="#ffffff">{$consignee[mobile]}</td>
					</tr>
					<tr>
						<td align="right" bgcolor=#ffffff>电话：</td>
						<td bgcolor=#ffffff>{$consignee[phone]}</td>
						<td align="right" bgcolor="#ffffff">最佳送货时间：</td>
						<td bgcolor="#ffffff">{$consignee[bestTime]}</td>
					</tr>
					<tr>
						<td align="right" bgcolor=#ffffff>标志建筑：</td>
						<td bgcolor=#ffffff>{$consignee[signBuilding]}</td>
						<td align="right" bgcolor=#ffffff>&nbsp;</td>
						<td bgcolor=#ffffff>&nbsp;</td>
					</tr>
				</tbody>
			</table>-->	
			<div style="border-top:2px #009900 solid">
				<span class="boldTitle">产品列表</span>
			</div>		
			<table class=floattable cellspacing=1 cellpadding=5 width="100%" align=center bgcolor=#e3e3e3 border=0>
				<tbody>
					<tr>
						<th width="15%" height="22" align="center" bgcolor=#ffffff>订货号</th>
						<th width="30%" height="22" align="center" bgcolor=#ffffff>产品说明</th>
						<th width="13%" height="22" align="center" bgcolor=#ffffff>本店价格</th>
						<th width="13%" height="22" align="center" bgcolor=#ffffff>会员价格</th>
						<th width="12%" height="22" align="center" bgcolor=#ffffff>小计</th>
						<th width="10%" align="center" bgcolor=#ffffff>优惠</th>
						<th width="7%" align="center" bgcolor=#ffffff>数量</th>
					</tr>
					<!--{loop $shoppingcartList $list}-->
					<tr>
						<td height="22" align="center" bgcolor=#ffffff><a href="product-detail-{$list[categoryId]}.htm" target="_blank">{$list[productNo]}</a></td>
						<td height="22" align="center" bgcolor=#ffffff>{$list[content]}</td>
						<td height="22" align=center bgcolor=#ffffff>￥$list[ourPrice]</td>
						<td height="22" align=center bgcolor=#ffffff class=price>￥$list[userPrice]</td>
						<td height="22" align=center bgcolor=#ffffff>￥$list[countPrice]</td>
						<td align=center bgcolor=#ffffff class=price>￥$list[offerPrice]</td>
						<td align=center bgcolor=#ffffff class=price>$list[cartCount]</td>
					</tr>
					<!--{/loop}-->
					<tr>
						<td style="font-size:14px; color:#FE6500; padding-left:10px; font-weight:bold" bgcolor=#ffffff colspan=8>购物金额小计￥{$order[totalPrice]}元</td>
					</tr>
				</tbody>
			</table>
		</form>
	</div>
</div>
{template footer}